/**
 * 进销存
 */
import { defineStore } from 'pinia';

export const useInventoryStore = defineStore('inventory', {
	state: () => ({
		// 配置菜单跳转列表的基础信息
		Menu: {} as any,
		// 跳转配置表单基础配置
		MenuDetail: {},
		// 配置列表单据字段设置
		FormColumnSetting: [],
		CurrModuleID: null,
		// 审批流起始配置信息
		st_comPageConfig: {
			approveWaitToOpenNext: false,
			showListApprove: false,
			showFormApprove: false,
			showGlobalPopup: false,
			approvalConfig: {},
			approveObj: {
				"tableId": 1,
				"workFlowVersionId": "",
				"workFlowDef": {
					"name": '',
					"publicFlag": 1,
					"sortNo": 1,
					"duplicateRemovelFlag": 1,
					"optionTip": "",
					"optionNotNull": 0,
					"status": 1
				},
				"directorMaxLevel": 10,
				"flowPermission": [],
				"nodeConfig": {
					"pkId": "sid-start-node",
					"nodeName": "发起人",
					"type": 0,
					"priorityLevel": "",
					"settype": "",
					"selectMode": "",
					"selectRange": "",
					"examineRoleId": "",
					"directorLevel": "",
					"replaceByUp": "",
					"examineMode": "",
					"noHanderAction": "",
					"examineEndType": "",
					"examineEndRoleId": "",
					"examineEndDirectorLevel": "",
					"ccSelfSelectFlag": "",
					"conditionList": [],
					"nodeUserList": [],
					"childNode": undefined
				}
			},
			nodeConfig: {},
			nodewarpIndex: null as any,
		}
	}),
	actions: {},
	getters: {},
	persist: {
		key: 'inventory-store',
		paths: [
			'st_comPageConfig.approveWaitToOpenNext',
		]
	}
})